import CryptoJS from "crypto-js";
/**
 * 前端aes加密方式
 * @param account 账号
 * @param password 密码
 * @param key key
 * @param iv iv
 */
export function aesencode(value: string, key: string, iv: string) {
  key = CryptoJS.enc.Hex.parse(key);
  iv = CryptoJS.enc.Hex.parse(iv);
  var aesEncryptor = CryptoJS.algo.AES.createEncryptor(key, {
    iv: iv
  });
  var enctext = aesEncryptor.finalize(value);
  return "aes" + CryptoJS.enc.Base64.stringify(enctext);
}
